//
//  WxbkViewController.m
//  Ten
//
//  Created by anfuer on 2018/8/18.
//  Copyright © 2018年 xg韦. All rights reserved.
//

#import "WxbkViewController.h"
#import "ZYLAlert.h"
#import "ZfbbkViewController.h"

@interface WxbkViewController ()
@property (weak, nonatomic) IBOutlet UILabel *titLb;
@property (weak, nonatomic) IBOutlet UIImageView *img;
@property (weak, nonatomic) IBOutlet UILabel *lb1;
@property (weak, nonatomic) IBOutlet UILabel *lb2;

@end

@implementation WxbkViewController

- (void)viewDidLoad {
    [super viewDidLoad];
//
    if ([_type isEqualToString:@"zfb"]) {
        _titLb.text=@"解绑支付宝账号";
        _img.image=WXGImage(@"支付宝");
        _lb1.text=WXGStr(_passdic[@"alipay_real_name"]);
        _lb2.text=@"更换支付宝账号";
    } else
    {
        _lb1.text=WXGStr(_passdic[@"wx_nickname"]);
    }
    
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



- (IBAction)btna:(UIButton *)sender {
    
    [FuncPublic getData:self parameters:@{@"type":[_type isEqualToString:@"zfb"]?@"1":@"2"} RequestUrl:CSalarydel_bind success:^(NSDictionary *acountInfo) {
        ZYLAlert *zylAlert = [[ZYLAlert alloc] initWithTitle:@"提示" message:@"已经解除原有绑定，是否绑定新的账号？"];
        [zylAlert addBtnAlertTitle:@"去绑定" action:^{
            UIStoryboard *mainStoryBoard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
            ZfbbkViewController*secondViewController = [mainStoryBoard instantiateViewControllerWithIdentifier:@"Zfbbk"];
            secondViewController.type=_type;
            [self.navigationController pushViewController:secondViewController animated:YES];

        }];
        [zylAlert addBtnAlertTitle:@"取消" action:^{
            [self.navigationController popToRootViewControllerAnimated:YES];
        }];
        
        [zylAlert showAlertWithSender:self];
    }];

    
}

@end
